package yeh.service.Impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yeh.dao.UserDao;
import yeh.domain.LoginLog;
import yeh.domain.User;
import yeh.service.UserService;

import java.util.Date;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    /**
     * 业务层接口实现类-登录
     * @param UserName
     * @param PassWord
     * @return
     */
    @Override
    public User Login(String UserName, String PassWord) {
        return userDao.SelectAll(UserName,PassWord);
    }

    /**
     * 业务层接口实现类-保存登录日志信息
     * @param UserName
     * @param Ip
     */
    @Override
    public void saveLog(String UserName, String Ip,Date LoginTime) {
        userDao.saveLoginLog(UserName,Ip,LoginTime);
    }

    /**
     * 业务层接口实现类-读取登录日志信息
     * @return
     */
    @Override
    public List<LoginLog> getLoginfo() {
        return userDao.getLoginLogs();
    }
}
